﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AspnetCore04.SettingModel;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;

namespace AspnetCore04.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class TestController : ControllerBase
    {
        ///api/Test/GetValue
        [Route("GetValue")]
        public String GetValue([FromServices]IOptions<WebSetting> options)
        {
            var webSetting = options.Value;

            return webSetting.Title;
        }

    }
}